libmylib.a: mystdio.o mymath.o
	@ar -rc $@ $^
	@echo "build $^ to $@ ... done"

#匹配所有.c文件生成对应的.o文件
%.o : %.c
	@gcc -c $<
	@echo "compiling $< to $@ ... done"

#清理文件
.PHONY:clean
clean:
	@rm -rf *.a *.o stdc*
	@echo "clean ... done"

#打包发布
.PHONY:output
output:
	@mkdir -p stdc/include
	@mkdir -p stdc/lib
	@cp -f *.h stdc/include
	@cp -f *.a stdc/lib
	@tar -czf stdc.tgz stdc
	@echo "output stdc ... done"
